package com.zyd.blog.persistence.mapper;

import com.zyd.blog.persistence.beans.Center;
import com.zyd.blog.persistence.beans.CenterNew;
import com.zyd.blog.persistence.beans.DesignArticle;
import com.zyd.blog.persistence.beans.Interest;
import com.zyd.blog.persistence.beans.es.EsDesignArticle;
import org.apache.ibatis.annotations.Select;
import org.jsoup.Connection;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Repository;
import tk.mybatis.mapper.common.BaseMapper;

import java.util.List;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author liusongqi
 * @since 2020-02-10
 */
@Repository
@Component
public interface DesignArticleMapper extends BaseMapper<DesignArticle> {
    List<CenterNew> soft(@Param(value = "userId") String userId,int page,int count);

    List<CenterNew> searchDesign(String value,@Param(value = "userId") String userId,int page,int count);
    Integer searchCount(String value);
    Integer searchCountAll(String value);
    List<CenterNew> personalSoft(@Param(value = "userId") String userId,int page,int count,String style);
    List<CenterNew> personalSoftOrder(@Param(value = "userId") String userId,int page,int count,String style,String coverUserId);

    /**    根据规则 变换 获取软装产品
     *      region 0省  1 市  2区  3全国  4 全省  5 全市
     *      sort  19智能排序  20 时间优先 21 点赞优先  22 热度优先
     *      style 只要不为空 直接传过去 就可
     */
    List<CenterNew> sort(@Param(value = "region") String region, @Param(value = "sort") String sort, @Param(value = "style") String style
            ,@Param(value = "province")String province,@Param(value = "city")String city,@Param(value = "area")String area,@Param(value = "userId") String userId,String place
           ,int page,int count);

    Integer topCount(@Param(value = "region") String region, @Param(value = "sort") String sort, @Param(value = "style") String style
            ,@Param(value = "province")String province,@Param(value = "city")String city,@Param(value = "area")String area,@Param(value = "userId") String userId,String place
    );

    Integer count(@Param(value = "region") String region, @Param(value = "sort") String sort, @Param(value = "style") String style
            ,@Param(value = "province")String province,@Param(value = "city")String city,@Param(value = "area")String area,@Param(value = "userId") String userId,String place
            );

    Integer fabulous(@Param(value = "id") String id);

    Integer reduceZan(@Param(value = "id") String id);

    Integer addCollection(@Param(value = "id") String id);

    Integer deleteCollection(@Param(value = "id") String id);

    CenterNew specific(@Param(value = "designId") String designId, @Param(value = "userId") String userId);

    Integer commentNum(@Param(value = "designId") String designId);

    Integer commentReduce(@Param(value = "designId") String designId);

    List<EsDesignArticle> getEsDesignArticle(int page, int limit);
    void userCount(String id);
    List<DesignArticle> recommendArticle(String designStyle,String designPlace,String id);

    Integer deleteCaoGao(String addTime);

    Integer updateDraft(@Param(value = "designId") String designId, @Param(value = "userId") String userId,@Param(value = "state") String state);

    List<CenterNew> myAdd(String userId,int page,int count);

    List<CenterNew> index(@Param(value = "userId") String userId,int page,int count);

    Integer updateOne(String designId,String designTitle,String coverImage,String designStyle,String designApartment,
                       String designPlace,String designContent,
                       String addTime,int areaNumber,String draft,String introduce, String placeContent,
                       String apartmentContent,
                       String styleContent,String topTime,String examine);

    Integer deleteArticle(String id);

    Integer updateEdit(String id);

    List<Interest> interestAll();

    Integer stopUser(String userId);

    Integer passUser(String userId);
}
